home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Presentations / Presentations ’97 / Sessions ’97 / Java for Macintosh Applications / Edit / Edit(JDK).r < prev    next >
Encoding:
Text File  |  1997-06-27  |  3.7 KB  |  183 lines  |  [TEXT/CWIE]

  1. /*
  2.     Edit(JDK).r
  3.  
  4.     Really simple Java text editor.
  5.  
  6.     © 1997 by Michael J. Webb (mjw@codewell.com)
  7.  
  8. */
  9.  
  10. #include "Types.r"
  11.  
  12. /*#include "RunnerTypes.r" */            // mjw - missing file!!!!!!
  13. #include "JavaTypes.r"
  14.  
  15. // note that the "./lib/" gets expanded in the 'LIBM' resource
  16. // mjw - Change this for your app's ZIP file.
  17. resource 'STR '(1, "Standalone App Class Path") {
  18.     "./lib/Edit.zip:/$INSTALLATION_CLAS/JDK-1.0.2"
  19. };
  20.  
  21. // Package of main app class.
  22. // mjw - Change this for your app.
  23. resource 'STR '(2, "Main App Class - Run This!") {
  24.     "Edit"
  25. };
  26.  
  27. /* Junk from sample
  28. resource 'STR#'(1, "Parameters for main(String args[])") {
  29.     {
  30.         "Space is Big",
  31.         "Space is Dark",
  32.         "Its hard to find",
  33.         "A place to park",
  34.         "",
  35.         "Burma Shave"
  36.     }
  37. };
  38. */
  39.  
  40. /* Missing file!
  41. resource 'JRun'(1, "Standalone Startup Resource") {
  42.     dontProtectApplication,                        // <not implemented yet>
  43.     noVerbose,                                    // don't be annoying by default
  44.     noDebug,                                    // <not implemented yet>
  45.     ascyncGC,                                    // GC occasionally
  46.     noVerboseGC,                                // don't annoy me
  47.  
  48.     noProfileData,                                // <not implemented yet>
  49.     noTraceData,                                // <not availiable in optimized version>
  50.     
  51.     default,                                    // use the default "C" stack size
  52.     default,                                    // use the default "Java" stack size (growable)
  53.     
  54.     default,                                    // 4 meg was the default maximum
  55.     default,                                    // 768k was the default minimum
  56.     
  57.     verifyBCRemote,                                // don't be _too_ anal, but watch network classes
  58.  
  59.     1,                                            // default 'STR ' for class path
  60.  
  61.     noStartingProps,                            // no starting property values
  62.     2,                                            // 'STR ' of the default app to run
  63.     noStartingAppAboutItem,                        // no app - no about
  64.     1,                                            // 'STR#' for parameters
  65.     
  66.     stderrRedirectionAlias, { 0, 0, 0, 0 },        // no redirection here
  67.     stdoutRedirectionAlias, { 0, 0, 0, 0 },        // no redirection here
  68.     
  69.     ":MacJava Prefs:StandaloneSample Prefs",
  70. };
  71.  
  72. // maps .lib names to resouces.
  73. /* mjw - Change this for your apps */
  74. resource 'LIBM'(1, "./lib/ folder item mappings") {
  75.     {
  76.         "Edit.zip",                            // name to replace
  77.         'ZIP!',                                    // resource type of the replacement
  78.         kAsNamedResource { "Edit.zip" },        // by name or by ID
  79.     }
  80. };
  81.  
  82. /* mjw - Change this for your apps */
  83.  
  84. // this reads the binary file Edit.zip into a resource of the given type and name
  85. read 'ZIP!'(128, "Edit.zip") "Edit.zip";
  86.  
  87. //------------------------------------------------------------------------------------
  88. // Stuff for a normal app.
  89.  
  90. #ifndef __TYPES_R__
  91. #include "Types.r"
  92. #endif
  93.  
  94. #ifndef __SYSTYPES_R__
  95. #include "SysTypes.r"
  96. #endif
  97.  
  98. #define kSignature            'µiΩ3'            // Application signature
  99. #define kFileType            'TEXT'            // Data file type
  100. #define kBinFileType        'BEEP'            // Binary file type
  101.  
  102. #define kBundleID            128
  103. #define kApplicationID        128
  104. #define kDocumentID            129
  105. #define kBinDocumentID        130
  106.  
  107. type kSignature as 'STR ';
  108. resource kSignature (0,
  109. "Signature",
  110.     purgeable)
  111. {
  112.     "JDK Edit Application © 1997 Michael J. Webb"
  113. };
  114.  
  115. resource 'FREF' (kApplicationID,
  116. "JDK Edit Application",
  117.     purgeable)
  118. {
  119.     'APPL',
  120.     0,
  121.     ""
  122. };
  123.  
  124. resource 'FREF' (kDocumentID,
  125. "JDK Edit Document",
  126.     purgeable)
  127. {
  128.     kFileType,
  129.     1,
  130.     ""
  131. };
  132.  
  133. resource 'FREF' (kBinDocumentID,
  134. "JDK Edit Binary Document",
  135.     purgeable)
  136. {
  137.     kBinFileType,
  138.     1,
  139.     ""
  140. };
  141.  
  142. resource 'BNDL' (kBundleID,
  143. "JDK Edit Application",
  144.     purgeable)
  145. {
  146.     kSignature,
  147.     0,
  148.     { /* array TypeArray: 2 elements */
  149.         /* [1] */
  150.         'ICN#',
  151.         { /* array IDArray: 3 elements */
  152.             0, kApplicationID,
  153.             1, kDocumentID,
  154.             2, kBinDocumentID
  155.         },
  156.         /* [2] */
  157.         'FREF',
  158.         { /* array IDArray: 3 elements */
  159.             0, kApplicationID,
  160.             1, kDocumentID,
  161.             2, kBinDocumentID
  162.         }
  163.     }
  164. };
  165.  
  166. // The revision of this particular file
  167.  
  168. RESOURCE 'vers' (1,
  169. "File Version",
  170.     purgeable)
  171. {
  172.     0x00,
  173.     0x00,
  174.     alpha,
  175.     0x001,
  176.     verUs,
  177.     "0.0a1",
  178.     "JDK Edit Application© 1997 Michael J. Webb"
  179. };
  180.  
  181. include "Edit Common.rsrc";
  182. include "JRUN(JDK).rsrc";
  183.